using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using HengTong.Model.Db.SupplyChain.Material;
using HengTong.Model.Db.SupplyChain.Partner;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.SupplyChain.Warehouse;

/// <summary>
/// 库存实体类
/// 用于管理仓库的物料库存信息
/// </summary>
[Display(Name = "库存", Description = "仓库库存管理", GroupName = "供应链")]
public class SysWarehouseStock : BasePoco
{
    /// <summary>
    /// 存储库位
    /// </summary>
    [Display(Name = "库位", Description = "存储库位", GroupName = "库存信息")]
    public SysWarehouseLocation Location { get; set; }
    
    /// <summary>
    /// 存储库位ID
    /// </summary>
    [Display(Name = "库位ID", Description = "存储库位ID", GroupName = "库存信息")]
    public Guid? LocationId { get; set; }
    
    /// <summary>
    /// 库存物料
    /// </summary>
    [Display(Name = "物料", Description = "库存物料", GroupName = "库存信息")]
    public SysMaterial Material { get; set; }
    
    /// <summary>
    /// 库存物料ID
    /// </summary>
    [Display(Name = "物料ID", Description = "库存物料ID", GroupName = "库存信息")]
    public Guid? MaterialId { get; set; }
    
    /// <summary>
    /// 库存数量
    /// </summary>
    [Display(Name = "数量", Description = "库存数量", GroupName = "库存信息")]
    [Column(TypeName = "decimal(18,6)")]
    public decimal Quantity { get; set; }
    
    /// <summary>
    /// 物料规格SKU
    /// </summary>
    [Display(Name = "物料SKU", Description = "物料规格SKU", GroupName = "库存信息")]
    public SysMaterialSku Sku { get; set; }
    
    /// <summary>
    /// 物料SKU ID
    /// </summary>
    [Display(Name = "SKU ID", Description = "物料SKU ID", GroupName = "库存信息")]
    public Guid? SkuId { get; set; }
    
    /// <summary>
    /// ERP系统中的编号
    /// </summary>
    [Display(Name = "ERP编号", Description = "ERP系统中的编号", GroupName = "库存信息")]
    [StringLength(128)]
    public string ErpId { get; set; }
    
    /// <summary>
    /// 物料批次号
    /// </summary>
    [Display(Name = "批次号", Description = "物料批次号", GroupName = "库存信息")]
    [StringLength(128)]
    public string BatchNumber { get; set; }
    
    /// <summary>
    /// 物料供应商
    /// </summary>
    [Display(Name = "供应商", Description = "物料供应商", GroupName = "库存信息")]
    public SysPartner Partner { get; set; }
    
    /// <summary>
    /// 供应商ID
    /// </summary>
    [Display(Name = "供应商ID", Description = "供应商ID", GroupName = "库存信息")]
    public Guid? PartnerId { get; set; }
    
    /// <summary>
    /// 存储类型
    /// </summary>
    [Display(Name = "存储类型", Description = "存储类型", GroupName = "库存信息")]
    public StoreType StoreType { get; set; }
}

public class SysWarehouseStockView : SysWarehouseStock{
    [Display(Name = "库位名称")]
    public String LocationName { get; set; }
    [Display(Name = "名称")]
    public String MaterialName { get; set; }
    [Display(Name = "名称")]
    public String SkuName { get; set; }
        
    public string SkuCode { get; set; }
    [Display(Name = "合作伙伴名称")]
    public String PartnerName { get; set; }
        
    public string WarehouseCode { get; set; }
        
    public string UnitName { get; set; }
        
    public string WarehouseName { get; set; }
    
    public string LocationCode { get; set; }
    
    public string MaterialCode { get; set; }
    
    public string UnitCode { get; set; }
}